import { Redirect } from 'umi';

export default (props) => {
  let token = sessionStorage.getItem('token') || '';
  if (token) {
    return <div>{props.children}</div>;
  } else {
    return <Redirect to="/login"></Redirect>;
  }
};
